/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package magic_model;

/**
 *
 * @author Tobias
 */
public class Card implements Comparable<Card> {
    private int quantity;
    private String name;
    private boolean isMain;

    public Card(int quantity, String name, boolean isMain) {
        this.quantity = quantity;
        this.name = name;
        this.isMain = isMain;
    }

    public Card(int quantity, String name) {
        this(quantity,name,true);
    }

    public boolean isMain() {
        return isMain;
    }

    public String getName() {
        return name;
    }

    public int getQuantity() {
        return quantity;
    }
    

    public int compareTo(Card o) {
      //sort after main/sb then alphabetically
        if(this.isMain){
            if(o.isMain){
              return this.name.compareTo(o.name);
            }else{
                return -1;
            }
        }else{
            if(o.isMain){
                return 1;
            }
            return this.name.compareTo(o.name);
        }
    }
            
}
